part of _;

extension on MainPage_Video {
  Future<List<VideoModel>> controller_loadData(bool isFirst) {
    void loadData(Completer completer) {
      yPost<VideoModel>(IFinal.Jkids.getVideos, null, (isSuccess, results, code, message) {
        if (!isSuccess) {
          yRun(() => loadData(completer), delay: 2000);
          return;
        }
        completer.complete(results);
      }, onModel: (map) => VideoModel.fromJson(map), showProgress: false, showErrorToast: false, cacheEnable: isFirst);
    }

    return yRunCompleter((completer) => loadData(completer));
  }
}
